home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / machserver / 1.098 / include / sx.h < prev    next >
C/C++ Source or Header  |  1989-05-12  |  3KB  |  146 lines

  1. /*
  2.  * sx.h --
  3.  *
  4.  *    This file contains declarations for things exported by the
  5.  *    sx module.
  6.  *
  7.  * Copyright (C) 1986, 1988 Regents of the University of California.
  8.  * Permission to use, copy, modify, and distribute this
  9.  * software and its documentation for any purpose and without
  10.  * fee is hereby granted, provided that the above copyright
  11.  * notice appear in all copies and that both that copyright
  12.  * notice and this permission notice appear in supporting
  13.  * documentation.  The University of California makes no
  14.  * representations about the suitability of this software for
  15.  * any purpose.  It is provided "as is" without express or
  16.  * implied warranty.
  17.  *
  18.  *
  19.  * $Header: /sprite/src/lib/sx/RCS/sx.h,v 1.5 89/05/12 09:15:31 ouster Exp $ SPRITE (Berkeley)
  20.  */
  21.  
  22. #ifndef _SX
  23. #define _SX
  24.  
  25. #ifndef _XLIB_H_
  26. #include <X11/Xlib.h>
  27. #endif
  28.  
  29. #ifndef _CLIENTDATA
  30. typedef int *ClientData;
  31. #define _CLIENTDATA
  32. #endif
  33.  
  34. #ifndef NULL
  35. #define NULL 0
  36. #endif
  37.  
  38. /*
  39.  * Exported handles for data structures:
  40.  */
  41.  
  42. typedef struct Sx_EventHandler *    Sx_EventHandler;
  43.  
  44. /*
  45.  * Structure used to describe one entry in a pull-down menu:
  46.  */
  47.  
  48. typedef struct Sx_MenuEntry {
  49.     char *leftText;        /* Text to display left-justified in
  50.                  * menu entry.  NULL means no text. */
  51.     char *centerText;        /* Text to display in center of menu
  52.                  * entry.  NULL means nothing. */
  53.     char *rightText;        /* Text to display right-justified in
  54.                  * menu entry.  NULL means no text. */
  55.     unsigned long background;    /* Color for background of menu entry.  -1
  56.                  * means pick a default color. */
  57.     void (*proc)();        /* Procedure to call when menu entry
  58.                  * is selected. */
  59.     ClientData clientData;    /* Client-supplied information to pass
  60.                  * to proc. */
  61. } Sx_MenuEntry;
  62.  
  63. /*
  64.  * Units for scrolling:
  65.  */
  66.  
  67. #define SX_SCROLL_ABSOLUTE    0
  68. #define SX_SCROLL_PAGES        1
  69.  
  70. /*
  71.  * Menu-related constants:
  72.  */
  73.  
  74. #define SX_MAX_MENU_ENTRIES    16
  75. #define SX_MAX_MENUS        16
  76.  
  77. /*
  78.  * Selection-related constants:
  79.  */
  80.  
  81. #define SX_FORMAT_SIZE        20
  82.  
  83. /*
  84.  * Directions, used in packing:
  85.  */
  86.  
  87. typedef enum {SX_TOP, SX_BOTTOM, SX_LEFT, SX_RIGHT} Sx_Side;
  88.  
  89. /*
  90.  * Exported procedures:
  91.  */
  92.  
  93. extern Sx_EventHandler    Sx_HandlerCreate();
  94. extern void        Sx_HandlerDelete();
  95. extern void        Sx_HandleEvent();
  96. extern void        Sx_EnableFocus();
  97. extern void        Sx_Focus();
  98.  
  99. extern Window        Sx_ButtonCreate();
  100. extern void        Sx_ButtonMake();
  101.  
  102. extern Window        Sx_EntryCreate();
  103. extern void        Sx_EntryMake();
  104.  
  105. extern Window        Sx_IconCreate();
  106. extern void        Sx_IconMake();
  107. extern Pixmap        Sx_IconGetInfo();
  108.  
  109. extern Window        Sx_MenuCreate();
  110. extern int        Sx_MenuGetInfo();
  111. extern int        Sx_MenuGetMask();
  112. extern int        Sx_MenuGetNames();
  113. extern Window        Sx_MenuGetWindow();
  114. extern void        Sx_MenuReplaceEntry();
  115. extern int        Sx_MenuSetMask();
  116.  
  117. extern int        Sx_Notify();
  118. extern void        Sx_Panic();
  119.  
  120. extern Window        Sx_CreatePacked();
  121. extern void        Sx_Pack();
  122. extern void        Sx_PackUpdateOff();
  123. extern void        Sx_PackUpdateOn();
  124. extern void        Sx_Unpack();
  125.  
  126. extern int        Sx_FocusEnabled();
  127. extern XFontStruct *    Sx_GetDefaultFont();
  128. extern int        Sx_NullProc();
  129. extern void        Sx_SetDefaultFont();
  130. extern void        Sx_SetErrorHandler();
  131.  
  132. extern Window        Sx_ScrollbarCreate();
  133. extern void        Sx_ScrollbarMake();
  134. extern void        Sx_ScrollbarSetRange();
  135. extern void        Sx_ScrollbarGetRange();
  136. extern int        Sx_ScrollbarWidth();
  137.  
  138. extern void        Sx_SelectionSet();
  139. extern void        Sx_SelectionClear();
  140. extern int        Sx_SelectionGet();
  141.  
  142. extern Window        Sx_TitleCreate();
  143. extern void        Sx_TitleMake();
  144.  
  145. #endif _SX
  146.